home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2007 January, February, March & April
/
Chip-Cover-CD-2007-02.iso
/
Pakiet multimedia
/
Animacje, filmy i prezentacje
/
Edytory i konwertery filmow
/
MediaCoder 0.5.1 pre12
/
MediaCoder-0.5.1-pre12.exe
/
htdocs
/
extensions
/
mpeg
/
main.js
< prev
Wrap
Text File
|
2006-10-16
|
2KB
|
66 lines
/*************************************************************************
* MediaCoder extension - MPEG Maker
* Distributed under GPL license
* Copyright (c) 2005-06 Stanley Huang <reachme@citiz.net>
* All rights reserved.
*************************************************************************/
function ApplyParams()
{
var doc = NewXML("MediaCoderPref");
if (!doc) {
alert("Error creating config XML");
return;
}
// container settings
var vidfmt = document.getElementById("vidfmt").value;
AddPrefNode(doc, "overall.video.muxer", "Default");
AddPrefNode(doc, "overall.video.container", vidfmt);
// video settings
AddPrefNode(doc, "overall.video.encoder", "FFMPEG");
AddPrefNode(doc, "overall.video.format", vidfmt);
AddPrefNode(doc, "overall.video.bitrate", document.getElementById("vb").value);
AddPrefNode(doc, "overall.video.mode", document.getElementById("pass").value);
AddPrefNode(doc, "videofilter.frame.enabled", "true");
AddPrefNode(doc, "videofilter.frame.nofpsinc", "false");
var fps = document.getElementById("fps").value.split("/");
if (fps.length < 2) {
AddPrefNode(doc, "videofilter.frame.fps", fps[0]);
AddPrefNode(doc, "videofilter.frame.fpsScale", "1");
} else {
AddPrefNode(doc, "videofilter.frame.fps", fps[0]);
AddPrefNode(doc, "videofilter.frame.fpsScale", fps[1]);
}
var res = document.getElementById("res").value.split("x");
AddPrefNode(doc, "videofilter.scale.enabled", (res[0] != "0"));
AddPrefNode(doc, "videofilter.scale.width", res[0]);
AddPrefNode(doc, "videofilter.scale.height", res[1]);
// audio settings
var audfmt = document.getElementById("audfmt").value;
switch (audfmt) {
case "No Audio":
AddPrefNode(doc, "overall.audio.encoder", audfmt);
break;
default:
AddPrefNode(doc, "overall.audio.encoder", "ffmpeg");
AddPrefNode(doc, "audioenc.ffmpeg.codec", audfmt);
AddPrefNode(doc, "audioenc.ffmpeg.bitrate", document.getElementById("ab").value);
AddPrefNode(doc, "audioenc.ffmpeg.streams", document.getElementById("streams").value);
break;
}
AddPrefNode(doc, "audiofilter.resample.samplerate", document.getElementById("srate").srate);
// post settings to MediaCoder
PostPrefXML(doc);
}
function Unload()
{
// stop playback on window close
SendCommand("stop_play");
}